package com.eight.cloud.logging.interfaces;

import cn.hutool.core.util.ObjectUtil;
import com.eight.cloud.logging.model.vo.OperationLogVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @InterfaceName: LogRecordService
 * @Author: TXC
 * @Date: 2025-02-14 10:55
 **/
public interface OperationLogService {
    Logger log = LoggerFactory.getLogger(OperationLogService.class);

    default void record(OperationLogVo operationLog) {
        if (ObjectUtil.isNotNull(operationLog)) {
            if (operationLog.getIsException() == 0) {
                log.info("{}", operationLog);
            }else {
                log.error("{}", operationLog);
            }
        }
    }
}
